const request = require('./request.js').default;

/**
 * 活动相关 API
 */
export const activityAPI = {
  /**
   * 获取排行榜数据
   * @param {Object} params - 查询参数
   * @param {string} params.type - 排行榜类型 (likes, collects, badges, reading)
   */
  getLeaderboard: (params = {}) => request('/activity/leaderboard', 'GET', params),

  /**
   * 获取月度挑战数据
   */
  getMonthlyChallenge: () => request('/activity/monthly-challenge', 'GET'),

  /**
   * 参与月度挑战
   * @param {string} activityId - 活动ID
   */
  joinMonthlyChallenge: (activityId) => request(`/activity/${activityId}/join`, 'POST'),

  /**
   * 获取活动列表
   * @param {Object} params - 查询参数
   */
  getActivityList: (params = {}) => request('/activity/list', 'GET', params),

  /**
   * 获取活动详情
   * @param {string} activityId - 活动ID
   */
  getActivityDetail: (activityId) => request(`/activity/${activityId}`, 'GET'),
};
